---
title: Create tracking metadata
summary: Composes a file-name tracking prefix encoding conversion and imaging intent.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-17
library: PdfAPI.Core
reference_type: package
operation_id: OP-12
trigger: PdfTrackingMetadata.Create(Guid, string, PdfConversionType, bool) invoked
---

# Create tracking metadata

This operation composes the file-name prefix convention that carries tracking metadata (application code, conversion type, imaging intent, and file id) across the PDF platform.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-12 |
| **Trigger** | Caller invokes `PdfTrackingMetadata.Create(Guid fileId, string applicationCode = "AUTO", PdfConversionType conversionType = Convert, bool shouldBeImaged = false)` |
| **Inputs** | File id, application code, conversion type, imaging flag |
| **Outputs** | Populated `PdfTrackingMetadata` with a composed `FilePrefix` |
| **Primary components** | `PdfAPI.Core.PdfTrackingMetadata.Create` |
| **Entry point** | `PdfAPI.Core\PdfTrackingMetadata.cs` |

## Steps

1. Populate `ApplicationCode` (default `"AUTO"`), `ConversionType`, `FileId`, and `ShouldBeImaged`. ([BR-31](../business-rules.md#br-31-tracking-metadata-defaults))
2. Compose the file prefix: `"A"` when the conversion type is `Convert`, otherwise `"M"`. ([BR-32](../business-rules.md#br-32-tracking-prefix-conversion-type-character))
3. Append `"I"` when the file should be imaged, otherwise `"E"`. ([BR-33](../business-rules.md#br-33-tracking-prefix-imaging-character))
4. Append `{applicationCode}_` and then the file id, and assign the result to `FilePrefix`. ([BR-34](../business-rules.md#br-34-tracking-prefix-format))

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start(["Create(fileId, appCode,<br>conversionType, shouldBeImaged)"]) --> Populate["Populate fields<br>with defaults"]
	Populate --> Type{conversionType<br>== Convert?}
	Type -->|Yes| A["'A'"]
	Type -->|No| M["'M'"]
	A --> Imaged{shouldBeImaged?}
	M --> Imaged
	Imaged -->|Yes| I["append 'I'"]
	Imaged -->|No| E["append 'E'"]
	I --> Append["append appCode_fileId"]
	E --> Append
	Append --> Return([FilePrefix assigned])
```

## Failure and edge-case behavior
- No validation of `fileId`, `applicationCode`, or numeric overflow is performed during composition.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [Security and authorization](../security-authorization.md)

## Sources
- `PdfAPI.Core\PdfTrackingMetadata.cs`
